from gpiozero import PWMLED, LED
from time import sleep

motor_pwm_1 = PWMLED(2)
motor_dir_1 = LED(3)
motor_pwm_2 = PWMLED(14)
motor_dir_2 = LED(15)
motor_pwm_3 = PWMLED(17)
motor_dir_3 = LED(27)
motor_pwm_4 = PWMLED(23)
motor_dir_4 = LED(24)

motor_pwm_1.value = 0.5
motor_pwm_2.value = 0.5
motor_pwm_3.value = 0.5
motor_pwm_4.value = 0.5

while True:
    motor_dir_1.on()
    motor_dir_2.off()
    motor_dir_3.on()
    motor_dir_4.off()
    sleep(5)
    motor_dir_1.off()
    motor_dir_2.on()
    motor_dir_3.off()
    motor_dir_4.on()
    sleep(5)